home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / src / commands / whereis.sh < prev    next >
Text File  |  1990-07-20  |  415b  |  23 lines

  1. : List all system directories containing the argument
  2. : Author: Terrence W. Holm
  3. if test $# -ne 1; then
  4.   echo "Usage:  whereis  name"
  5.   exit 1
  6. fi
  7.  
  8. path="/bin /lib /etc\
  9.       /usr/bin /usr/lib\
  10.       /usr/include /usr/include/sys"
  11.  
  12. for dir in $path; do
  13.   for file in $dir/$1 $dir/$1.*; do
  14.     if test -f $file; then
  15.       echo $file 
  16.     elif test -d $file; then
  17.       echo $file/
  18.       fi
  19.     done
  20.   done
  21.  
  22. exit 0
  23.